import request from '@/config/axios'

export interface ConfigVO {
  brokerageEnabled: boolean
  brokerageEnabledCondition: number
  brokerageBindMode: number
  brokeragePosterUrls: string
  brokerageFirstPercent: number
  brokerageSecondPercent: number
  brokerageWithdrawMinPrice: number
  brokerageFrozenDays: number
  brokerageWithdrawTypes: string
  deliveryExpressFreePrice: any
}

// 查询交易中心配置详情
export const getTradeConfig = async () => {
  return await request.get({ url: `/trade/config/get` })
}

// 保存交易中心配置
export const saveTradeConfig = async (data: ConfigVO) => {
  return await request.put({ url: `/trade/config/save`, data })
}

// 创建27分销
export const createDistributionConfig27 = (data: any) => {
  return request.post({ url: '/trade/distribution-config27/create', data })
}

// 查询27分销
export const getDistributionConfig27 = () => {
  return request.get({ url: '/trade/distribution-config27/get' })
}

// 更新27分销
export const updateDistributionConfig27 = (data: any) => {
  return request.put({ url: '/trade/distribution-config27/update', data })
}
